// pages/components/pay/x.js
const api = require('../../../utils/request')
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    desc:{
      type: String,
      value: ''
    },
    title:{
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    isSuccess:false, //是否验证成功
    score: '',
    newPassword:'FYLA'
  },

  /**
   * 组件的方法列表
   */
  methods: {
    hideClose() {
      this.triggerEvent('close')
    },
    
    scoreInput(e) {
      const val = e.detail.value;
      this.setData({
        score: val,
      });
    },
    newPasswordInput(e) {
      const val = e.detail.value;
      this.setData({
        newPassword: val,
      });
    },
    setStep() {
      let _this = this
      api._get('/api?method=user.paypwdcheck',{pwd:this.data.newPassword},'noload').then(res=>{
        getApp().toast('验证成功')
        setTimeout(function() {
          // _this.hideClose()
          _this.triggerEvent('pwdcheck_success',_this.data.newPassword)
        },1000)
      })  
    }
  }
})